/**
*	@class tgaLoader
*
*	@brief
*
*	@author William McVicar
*/

#pragma once

#ifndef __TGALOADER_H_INCLUDED__
#define __TGALOADER_H_INCLUDED__

//  Library Includes

//  Local Includes
#include "../Image.h"

//  Macros

//  Forward Declarations

//  Types

namespace Protein
{

typedef struct
{
	byte Header[12];
} TGAHeader;

typedef struct
{
	u8		header[6];		
	u32		bytesPerPixel;	
	u32		imageSize;		
	u32		temp;			
	u32		type;	
	u32		Height;			
	u32		Width;			
	u32		Bpp;			
} TGA;

}

//  Constants

//  Prototypes

namespace Protein
{

class CTGA
{
	//Member Functions
public:

	static bool Load( const c8* _szFilename, Image& _rImage );

protected: 

private: 

	static bool loadCompressed( FILE* file, Image& _rImage, const std::string& path );
	static bool loadUncompressed( FILE* file, Image& _rImage, const std::string& path );

	//Member Variables
public:

protected: 

private: 

	static u8 uTGAcompare[12];
	static u8 cTGAcompare[12];

};

}

#endif //__TGALOADER_H_INCLUDED__
